home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-11 | 8.6 KB | 287 lines | [TEXT/MPS ] |
- ;
- ; File: Devices.a
- ;
- ; Copyright: © 1984-1994 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__DEVICES__') = 'UNDEFINED' THEN
- __DEVICES__ SET 1
-
-
- IF &TYPE('__OSUTILS__') = 'UNDEFINED' THEN
- include 'OSUtils.a'
- ENDIF
- ; include 'Types.a' ;
- ; include 'ConditionalMacros.a' ;
- ; include 'MixedMode.a' ;
- ; include 'Memory.a' ;
-
- IF &TYPE('__FILES__') = 'UNDEFINED' THEN
- include 'Files.a'
- ENDIF
-
- IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
- include 'Quickdraw.a'
- ENDIF
- ; include 'QuickdrawText.a' ;
-
- IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
- include 'Events.a'
- ENDIF
-
- IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
- include 'Dialogs.a'
- ENDIF
- ; include 'Errors.a' ;
- ; include 'Windows.a' ;
- ; include 'Controls.a' ;
- ; include 'Menus.a' ;
- ; include 'TextEdit.a' ;
-
- chooserInitMsg EQU 11 ; the user selected this device package
- newSelMsg EQU 12 ; the user made new device selections
- fillListMsg EQU 13 ; fill the device list with choices
- getSelMsg EQU 14 ; mark one or more choices as selected
- selectMsg EQU 15 ; the user made a selection
- deselectMsg EQU 16 ; the user canceled a selection
- terminateMsg EQU 17 ; allows device package to clean up
- buttonMsg EQU 19 ; the user selected a button
-
- ; Values of the 'caller' parameter to a Chooser device package
- chooserID EQU 1
-
- ; Values of the 'message' parameter to a Control Panel 'cdev'
- initDev EQU 0 ;Time for cdev to initialize itself
- hitDev EQU 1 ;Hit on one of my items
- closeDev EQU 2 ;Close yourself
- nulDev EQU 3 ;Null event
- updateDev EQU 4 ;Update event
- activDev EQU 5 ;Activate event
- deactivDev EQU 6 ;Deactivate event
- keyEvtDev EQU 7 ;Key down/auto key
- macDev EQU 8 ;Decide whether or not to show up
- undoDev EQU 9
- cutDev EQU 10
- copyDev EQU 11
- pasteDev EQU 12
- clearDev EQU 13
- cursorDev EQU 14
-
- ; Special values a Control Panel 'cdev' can return
- cdevGenErr EQU -1 ;General error; gray cdev w/o alert
- cdevMemErr EQU 0 ;Memory shortfall; alert user please
- cdevResErr EQU 1 ;Couldn't get a needed resource; alert
- cdevUnset EQU 3 ; cdevValue is initialized to this
-
- ; Values of the 'message' parameter to a Monitor 'mntr'
- initMsg EQU 1 ;initialization
- okMsg EQU 2 ;user clicked OK button
- cancelMsg EQU 3 ;user clicked Cancel button
- hitMsg EQU 4 ;user clicked control in Options dialog
- nulMsg EQU 5 ;periodic event
- updateMsg EQU 6 ;update event
- activateMsg EQU 7 ;not used
- deactivateMsg EQU 8 ;not used
- keyEvtMsg EQU 9 ;keyboard event
- superMsg EQU 10 ;show superuser controls
- normalMsg EQU 11 ;show only normal controls
- startupMsg EQU 12 ;code has been loaded
-
- ; control codes for DeskAccessories
- goodbye EQU -1 ; heap being reinitialized
- killCode EQU 1 ; KillIO requested
- accEvent EQU 64 ; handle an event
- accRun EQU 65 ; time for periodic action
- accCursor EQU 66 ; change cursor shape
- accMenu EQU 67 ; handle menu item
- accUndo EQU 68 ; handle undo command
- accCut EQU 70 ; handle cut command
- accCopy EQU 71 ; handle copy command
- accPaste EQU 72 ; handle paste command
- accClear EQU 73 ; handle clear command
-
- ; miscellaneous Device Manager constants
- ioInProgress EQU 1 ; predefined value of ioResult while I/O is pending
- aRdCmd EQU 2 ; low byte of ioTrap for Read calls
- aWrCmd EQU 3 ; low byte of ioTrap for Write calls
- asyncTrpBit EQU 10 ; trap word modifier
- noQueueBit EQU 9 ; trap word modifier
-
- ; flags used in the driver header and device control entry
- dReadEnable EQU 0 ; set if driver responds to read requests
- dWritEnable EQU 1 ; set if driver responds to write requests
- dCtlEnable EQU 2 ; set if driver responds to control requests
- dStatEnable EQU 3 ; set if driver responds to status requests
- dNeedGoodBye EQU 4 ; set if driver needs time for performing periodic tasks
- dNeedTime EQU 5 ; set if driver needs time for performing periodic tasks
- dNeedLock EQU 6 ; set if driver must be locked in memory as soon as it is opened
- dNeedLockMask EQU $4000 ; set if driver must be locked in memory as soon as it is opened
- dNeedTimeMask EQU $2000 ; set if driver needs time for performing periodic tasks
- dNeedGoodByeMask EQU $1000 ; set if driver needs to be called before the application heap is initialized
- dStatEnableMask EQU $0800 ; set if driver responds to status requests
- dCtlEnableMask EQU $0400 ; set if driver responds to control requests
- dWritEnableMask EQU $0200 ; set if driver responds to write requests
- dReadEnableMask EQU $0100 ; set if driver responds to read requests
-
- ; run-time flags used in the device control entry
- dOpened EQU 5 ; driver is open
- dRAMBased EQU 6 ; dCtlDriver is a handle (1) or pointer (0)
- drvrActive EQU 7 ; driver is currently processing a request
- drvrActiveMask EQU $0080 ; driver is currently processing a request
- dRAMBasedMask EQU $0040 ; dCtlDriver is a handle (1) or pointer (0)
- dOpenedMask EQU $0020 ; driver is open
-
- DRVRHeader RECORD 0
- drvrFlags ds.w 1
- drvrDelay ds.w 1
- drvrEMask ds.w 1
- drvrMenu ds.w 1
- drvrOpen ds.w 1
- drvrPrime ds.w 1
- drvrCtl ds.w 1
- drvrStatus ds.w 1
- drvrClose ds.w 1
- drvrName ds.b 1
- sizeof EQU 20
- ENDR
-
- DCtlEntry RECORD 0
- dCtlDriver ds.l 1
- dCtlFlags ds.w 1
- dCtlQHdr ds QHdr
- dCtlPosition ds.l 1
- dCtlStorage ds.l 1
- dCtlRefNum ds.w 1
- dCtlCurTicks ds.l 1
- dCtlWindow ds.l 1
- dCtlDelay ds.w 1
- dCtlEMask ds.w 1
- dCtlMenu ds.w 1
- sizeof EQU 40
- ENDR
-
- AuxDCE RECORD 0
- dCtlDriver ds.l 1
- dCtlFlags ds.w 1
- dCtlQHdr ds QHdr
- dCtlPosition ds.l 1
- dCtlStorage ds.l 1
- dCtlRefNum ds.w 1
- dCtlCurTicks ds.l 1
- dCtlWindow ds.l 1
- dCtlDelay ds.w 1
- dCtlEMask ds.w 1
- dCtlMenu ds.w 1
- dCtlSlot ds.b 1
- dCtlSlotId ds.b 1
- dCtlDevBase ds.l 1
- dCtlOwner ds.l 1
- dCtlExtDev ds.b 1
- fillByte ds.b 1
- dCtlNodeID ds.l 1
- sizeof EQU 56
- ENDR
-
- ;
- ; SetChooserAlert used to simply set a bit in a low-mem global
- ; to tell the Chooser not to display its warning message when
- ; the printer is changed. However, under MultiFinder and System 7,
- ; this low-mem is swapped out when a layer change occurs, and the
- ; Chooser never sees the change. It is obsolete, and completely
- ; unsupported on the PowerPC. 68K apps can still call it if they
- ; wish.
- ;
- IF OLDROUTINENAMES ** ¬ GENERATINGCFM THEN
- ENDIF
- ;
- ; Note: DrvrInstall() is no longer supported, becuase it never really worked anyways.
- ; There will soon be a DriverInstall() which does the right thing.
- ;
- ; DrvrRemove has been renamed to DriverRemove. But, InterfaceLib for PowerPC
- ; still exports DrvrRemove, so a macro is used to map the new name to old.
- ;
- ;
- IF GENERATING68K THEN
- _DrvrRemove: OPWORD $A03E
- ELSE
- IMPORT DrvrRemove
- ENDIF
-
- IF GENERATING68K THEN
- _PBControlSync: OPWORD $A004
- ELSE
- IMPORT PBControlSync
- ENDIF
-
- IF GENERATING68K THEN
- _PBControlAsync: OPWORD $A404
- ELSE
- IMPORT PBControlAsync
- ENDIF
-
- IF GENERATING68K THEN
- _PBControlImmed: OPWORD $A204
- ELSE
- IMPORT PBControlImmed
- ENDIF
-
- IF GENERATING68K THEN
- _PBStatusSync: OPWORD $A005
- ELSE
- IMPORT PBStatusSync
- ENDIF
-
- IF GENERATING68K THEN
- _PBStatusAsync: OPWORD $A405
- ELSE
- IMPORT PBStatusAsync
- ENDIF
-
- IF GENERATING68K THEN
- _PBStatusImmed: OPWORD $A205
- ELSE
- IMPORT PBStatusImmed
- ENDIF
-
- IF GENERATING68K THEN
- _PBKillIOSync: OPWORD $A006
- ELSE
- IMPORT PBKillIOSync
- ENDIF
-
- IF GENERATING68K THEN
- _PBKillIOAsync: OPWORD $A406
- ELSE
- IMPORT PBKillIOAsync
- ENDIF
-
- IF GENERATING68K THEN
- _PBKillIOImmed: OPWORD $A206
- ELSE
- IMPORT PBKillIOImmed
- ENDIF
-
- IF GENERATING68K THEN
- _OpenDeskAcc: OPWORD $A9B6
- ELSE
- IMPORT OpenDeskAcc
- ENDIF
-
- IF GENERATING68K THEN
- _CloseDeskAcc: OPWORD $A9B7
- ELSE
- IMPORT CloseDeskAcc
- ENDIF
-
- ENDIF ; __DEVICES__
-